<!--#include("_header.html")-->
<!--%import("js/at.js")-->
<!--%import("filter/insert_attendance.xml")-->
{@$year=substr($selected_date,0,4)}
{@$month=substr($selected_date,4,2)}
{@$day=substr($selected_date,6,2)}
{@$week=$oAttendanceModel->getWeek($selected_date)}
<script type="text/javascript">
    var warn_msg = '{$lang->attend_warn}';
</script>

<div id="att_board_body">
    <!--//도장버튼 노출-->
    <!--@if($is_logged)-->
	    <!--//출석을 하지 않았고, 출석 가능한 시간대라면-->
	    <!--@if($oAttendanceModel->getIsChecked($logged_info->member_srl) == 0 && $is_available == 0 )-->
            <!--@if($config->about_admin_check!='no')-->
                <div class="attendance_button">
                    <p class="at_info_msg">{$lang->input_text}</p>
	                <form action="./" method="post" id="click_button_mobile" onsubmit="return attendance_check_mobile()">
		                <input type="text" name="greetings" class="a_text" onclick="this.value='';" onkeypress="return text_entercheck_mobile(event); "/>
		                <input type="hidden" name="about_position" value="yes" />
		                <p class="att_btn_align"><input type="image" src="./images/button_black.gif" alt="{$lang->click}" /></p>
	                </form>
                </div>
            <!--@else-->
                <!--@if($logged_info->is_admin != 'Y')-->
                    <div class="attendance_button">
                        <p class="at_info_msg">{$lang->input_text}</p>
	                    <form action="./" method="post" id="click_button_mobile" onsubmit="return attendance_check_mobile()">
		                    <input type="text" name="greetings" class="a_text" onclick="this.value='';" onkeypress="return text_entercheck_mobile(event); "/>
		                    <input type="hidden" name="about_position" value="yes" />
		                    <p class="att_btn_align"><input type="image" src="./images/button_black.gif" alt="{$lang->click}" /></p>
	                    </form>
                    </div>
                <!--@end-->
            <!--@end-->
        <!--@elseif($is_available ==1)-->
            <!--//출석불가능 시간대 설명-->
            <div class="attennae_denied">
                {$lang->attend_banned_time} ({substr($config_data->start_time,0,2)}:{substr($config_data->start_time,2,2)}~{substr($config_data->end_time,0,2)}:{substr($config_data->end_time, 2,2)})
            </div>
	    <!--@end-->
    <!--@end-->

    <!--//지금 출석하시면 받을 수 있는 포인트 목록-->
    <div class="point_list" id="point_list">
        <ul style="line-height:1.6;">
            <li>{$lang->attendance_add_point} : {$config_data->add_point}</li>
            <li>{$lang->attendance_first_point} : {$config_data->first_point}</li>
            <li>{$lang->attendance_second_point} : {$config_data->second_point}</li>
            <li>{$lang->attendance_third_point} : {$config_data->third_point}</li>
            <li>{$lang->attendance_yearly_point} : {$config_data->yearly_point}</li>
            <li>{$lang->attendance_monthly_point} : {$config_data->monthly_point}</li>
            <li>{$lang->attendance_weekly_point} : {$config_data->weekly_point}</li>
            <!--@if($config_data->target_day==$selected_date && $config_data->about_target == 'yes')--><li>{$lang->attendance_target_point} : {$config_data->target_point}</li><!--@end-->
            <!--@if($config_data->about_continuity=='yes')-->
                <li>{$lang->attendance_continuity_day} : {$config_data->continuity_day}{$lang->attendance_after_day}</li>
                <li>{$lang->attendance_continuity_point} : {$config_data->continuity_point}</li>
            <!--@end-->
            <!--@if($config_data->about_diligence_yearly == 'yes')-->
                <li>{$lang->attendance_diligence_yearly_point} : {$config_data->diligence_yearly_point}({$config_data->diligence_yearly}{$lang->attendance_after_day})</li>
            <!--@end-->
            <!--@if($config_data->about_diligence_monthly == 'yes')-->
                <li>{$lang->attendance_diligence_monthly_point} : {$config_data->diligence_monthly_point}({$config_data->diligence_monthly}{$lang->attendance_after_day})</li>
            <!--@end-->
            <!--@if($config_data->about_diligence_weekly == 'yes')-->
                <li>{$lang->attendance_diligence_weekly_point} : {$config_data->diligence_weekly_point}({$config_data->diligence_weekly}{$lang->attendance_after_day})</li>
            <!--@end-->
        </ul>
    </div>

    <!--//출석달력 출력-->
    <!--@if($is_logged)-->
    <div class="calendar_view" id="calendar_view">
        <!--#include("calendar.html")-->
    </div>
    <!--@end-->

    <!--//달력 선택-->
    <div class="at_top_box">
        <p class="at_date_pick">
            <a href="{getUrl('document_srl','','selected_date',zDate(date('YmdHis',mktime(0,0,0,$month, $day-1, $year)),'Ymd'))}">←</a>
             <a href="{getUrl('document_srl','','selected_date',zDate(date('YmdHis'),"Ymd"))}"> {$year}-{$month}-{$day} </a>
            <a href="{getUrl('document_srl','','selected_date',zDate(date('YmdHis',mktime(0,0,0,$month, $day+1, $year)),'Ymd'))}"> →</a>
        </p>
        <p class="buttons_box">
                <!--@if($is_logged)-->
                    <a id="point_click" href="#point_list" alt="{$lang->attend_point_list}">{$lang->attend_point_list}</a>
                    <a id="calendar_click" href="#point_list" alt="{$lang->attend_calendar}">□{$lang->attend_calendar}</a>
                <!--@else--><a id="point_click" href="#point_list" >{$lang->attend_point_list}</a>
                <!--@end-->
        </p>
    </div>

    <!--//등수변수 초기화-->
    <!--@if($module_info->order_type=='desc')-->
        {@$position=($module_info->start_num)-($module_info->list_count*($oAttendance->page-1))}
    <!--@else-->
        {@$position=1+($oAttendance->page-1)*$module_info->list_count}
    <!--@end-->

    <ul class="at_board" >
        <!--@if($oAttendanceAdminModel->getTodayTotalCount($selected_date)==0)-->
            <li class="at_board_title">{$lang->attend_no_checked}</li>
        <!--@else-->
            <li class="at_board_title">{$lang->position} | <span class="f_gray">{$lang->nick_name}</span> | {$lang->time} | <span class="f_red">{$lang->today_added_point}</span> | <span class="f_blue">{$lang->greetings}</span></li>
        <!--@end-->


    <!--//출석한 사람이 있다면 반복문 시작-->
    <!--//쿼리를 통해 받은 사용자정보를 순서대로 얻어오는 구문-->
    <!--@foreach($oAttendance->data as $data)-->
        {@$is_perfect=$oAttendanceModel->isPerfect($data->member_srl, $selected_date)}
        {@$weekly = $oAttendanceModel->getWeeklyData($data->member_srl, $week)}
            {@$member = $oMemberModel->getMemberInfoByMemberSrl($data->member_srl)}
            <!--@if(ereg("^#[0-9]+$",$data->greetings))-->
                {@$length_greetings = strlen($data->greetings) -1}
                {@$oDocument = $oDocumentModel->getDocument(substr($data->greetings,1,$length_greetings))}
                <!--@if($oDocument->document_srl)-->
                    {@$exist_document = 1}
                <!--@else-->
                    {@$exist_document = 0}
                <!--@end-->
            <!--@else-->
                {@$exist_document = 0}
            <!--@end-->
            <li class="at_board_body">{$position} | <span class="f_gray">{cut_str($member->nick_name,5,'~')}</span> | {substr($data->regdate,8,2).":".substr($data->regdate,10,2).":".substr($data->regdate,12,2)} | <!--@if($module_info->display_bonus=='Y')--><a onclick="bonusView('bonus_{$member->member_srl}')" href="#bonus_{$member->member_srl}"><!--@end--><span class="f_red">{$data->today_point}</span><!--@if($module_info->display_bonus=='Y')--></a><!--@end--> |
                <!--@if($data->greetings)-->
                    <!--@if($exist_document == 1)-->
                        <a href="#{$oDocument->document_srl}" onclick="documentView('d_{$oDocument->document_srl}')"><span class="f_blue">{cut_str($oDocument->getContentText(text),15,'~')}</span></a>
                    <!--@else-->
                        {@$greetings_filtering = str_replace('<','&lt;',$data->greetings)}<span class="f_blue">
                        <!--@if($data->greetings!='^admin_checked^' && $data->greetings!='^auto^')-->{cut_str($greetings_filtering, 15, '~')}
                        <!--@elseif($data->greetings=='^admin_checked^')-->{$lang->attendance_admin_checked}
                        <!--@elseif($data->greetings=='^auto^')-->{$lang->attend_auto_check}
                        <!--@else-->{$lang->default_greetings}
                        <!--@end--></span>
                    <!--@end-->
                <!--@else-->
                    {$lang->attend_no_greetings}
                <!--@end--></li>

            <!--@if($module_info->display_bonus=='Y')-->
            <div class="at_greetings" id="bonus_{$member->member_srl}">
			        <!--@if($member->user_id)-->
                    <ul>
                        <li><span class="f_gray">{$member->nick_name}</span></li>
                        <li>{$lang->attendance_add_point} : {$config_data->add_point}</li>
		                <!--@if($position==1 && $data->greetings!='^admin_checked^')-->
			                <li>{$lang->attendance_first_point} : {$config_data->first_point}</li>
		                <!--@elseif($position==2 && $data->greetings!='^admin_checked^')-->
                            <li>{$lang->attendance_second_point} : {$config_data->second_point}</li>
		                <!--@elseif($position==3 && $data->greetings!='^admin_checked^')-->
                            <li>{$lang->attendance_third_point} : {$config_data->third_point}</li>
                        <!--@end-->
			            <!--@if($is_perfect->yearly_perfect)--><li>{$lang->attendance_yearly_point} : {$config_data->yearly_point}</li><!--@end-->
			            <!--@if($is_perfect->monthly_perfect)--><li>{$lang->attendance_monthly_point} : {$config_data->monthly_point}</li><!--@end-->
			            <!--@if($weekly->weekly == 7 && $selected_date == $week->sunday)--><li>{$lang->attendance_weekly_point} : {$config_data->weekly_point}</li><!--@end-->
			            <!--@if($config_data->target_day==$selected_date && $config_data->about_target == 'yes')--><li>{$lang->attendance_target_point} : {$config_data->target_point}</li><!--@end-->
			            <!--@if($oAttendanceModel->isExistContinuity($data->member_srl, $selected_date)>0 && $config_data->about_continuity=='yes')-->
				            {@$cont = $oAttendanceModel->getContinuityData($data->member_srl, $selected_date)}
				            <!--@if($cont->data >= $config_data->continuity_day)--><li>{$lang->attendance_continuity_point} : {$config_data->continuity_point}</li><!--@end-->
			            <!--@end-->
                        <!--@if($config_data->about_diligence_yearly == 'yes' && $oAttendanceModel->checkYearlyDiligence($data->member_srl, $config_data->diligence_yearly, $year) == 1)-->
                            <li>{$lang->attendance_diligence_yearly_point} : {$config_data->diligence_yearly_point}({$config_data->diligence_yearly}{$lang->attendance_after_day})</li>
                        <!--@end-->
                        <!--@if($config_data->about_diligence_monthly == 'yes' && $oAttendanceModel->checkMonthlyDiligence($data->member_srl, $config_data->diligence_monthly, $year.$month) == 1)-->
                            <li>{$lang->attendance_diligence_monthly_point} : {$config_data->diligence_monthly_point}({$config_data->diligence_monthly}{$lang->attendance_after_day})</li>
                        <!--@end-->
                        <!--@if($config_data->about_diligence_weekly == 'yes' && $oAttendanceModel->checkWeeklyDiligence($data->member_srl, $config_data->diligence_weekly, $selected_date) == 1)-->
                            <li>{$lang->attendance_diligence_weekly_point} : {$config_data->diligence_weekly_point}({$config_data->diligence_weekly}{$lang->attendance_after_day})</li>
                        <!--@end-->
                        <!--@if($logged_info->is_admin=="Y" && $grant->manager == 1)-->
                            <li><a href="{getUrl('act','dispAttendanceMobileModifyAttendance','mid','attendance','attendance_srl',$data->attendance_srl,'selected_date',$selected_date, 'm',$m)}"><span class="f_red">{$lang->cmd_modify}</span></a></li>
                        <!--@end-->
                    </ul>
                    <!--@else-->
                        -
                    <!--@end-->
                </div>
                <!--@end-->
            <!--@if($data->greetings)-->
                <!--@if($exist_document == 1)-->
                    <div class="at_greetings" id="d_{$oDocument->document_srl}" <!--@if($document_srl==$oDocument->document_srl)-->style="display:block;"<!--@end-->>
                        {$oDocument->getContentText(text)}<br /><span class="f_gray">- {$member->nick_name}</span>
                    </div>
                <!--@end-->
            <!--@end-->
        <!--@if($module_info->order_type=='desc')-->{@$position--}<!--@else-->{@$position++}<!--@end-->
    <!--@end-->
    </ul>

    <!--//페이지 내비게이션-->
    <div class="at_pagenation">
       <a href="{getUrl('page',$oAttendance->page_navigation->first_page,'module_srl','')}" class="prevEnd">←</a> 
	    <!--@while($page_no = $oAttendance->page_navigation->getNextPage())-->
		    <!--@if($oAttendance->page == $page_no)-->
			    <strong>{$page_no}</strong>
		    <!--@else-->
			    <a href="{getUrl('page',$page_no,'module_srl','')}">{$page_no}</a> 
		    <!--@end-->
	    <!--@end--> <a href="{getUrl('page',$oAttendance->page_navigation->last_page,'module_srl','')}" class="nextEnd">→</a>
    </div>

</div>
